from django.conf.urls import url
from .views import auction, goods, cart, order, window, notice
from apps.web.views import reports

urlpatterns = [
    url(r'^(?P<version>[v1]+)/menu/$', goods.MenuView.as_view({'get': 'list'})),
    url(r'^(?P<version>[v1]+)/menu/(?P<pk>\d+)$', goods.MenuView.as_view({'get': 'retrieve'})),
    url(r'^(?P<version>[v1]+)/credential/$', goods.OssCredentialView.as_view()),
    # url(r'^(?P<version>[v1]+)/detail/$', goods.DetailView.as_view({'get': 'list'})),
    url(r'^(?P<version>[v1]+)/detail/(?P<pk>\d+)$', goods.DetailView.as_view({'get': 'retrieve'})),
    url(r'^(?P<version>[v1]+)/login/$', auction.LoginView.as_view()),
    url(r'^(?P<version>[v1]+)/cart/$',
        cart.CartView.as_view({'get': 'retrieve', 'post': 'create', 'delete': 'destroy'})),
    url(r'^(?P<version>[v1]+)/cart/(?P<pk>\d+)$', cart.CartView.as_view({'put': 'update'})),
    url(r'^(?P<version>[v1]+)/cart/settlement/$', cart.CartSettleView.as_view({'get': 'retrieve'})),
    url(r'^(?P<version>[v1]+)/order/$', order.OrderView.as_view({'get': 'list', 'post': 'create', })),
    url(r'^(?P<version>[v1]+)/order/(?P<pk>\d+)$', order.OrderView.as_view({'get': 'retrieve', 'put': 'update'})),
    url(r'^(?P<version>[v1]+)/ordermanage/$', order.OrderManageView.as_view({'get': 'list', })),
    url(r'^(?P<version>[v1]+)/ordermanage/(?P<pk>\d+)$',
        order.OrderManageView.as_view({'put': 'update'})),
    url(r'^(?P<version>[v1]+)/orderquery/$',
        order.OrderQueryView.as_view({'get': 'list'})),
    url(r'^(?P<version>[v1]+)/window/$',
        window.WindowView.as_view({'get': 'retrieve', 'put': 'update'})),
    # url(r'^(?P<version>[v1]+)/report/$',
    #     reports.ShopReport.as_view({'post': 'list'})),
    url(r'^(?P<version>[v1]+)/gettoken/$',
        order.Gettoken.as_view()),
    url(r'^(?P<version>[v1]+)/windowindex/(?P<pk>\d+)$', window.WindowIndexView.as_view()),
    url(r'^(?P<version>[v1]+)/windowgoods/$', window.WindowGoodsView.as_view({'get': 'list', 'post': 'create'})),
    url(r'^(?P<version>[v1]+)/windowgoods/(?P<pk>\d+)$', window.WindowGoodsView.as_view({'put': 'update'})),
    url(r'^(?P<version>[v1]+)/goodsStatus/(?P<pk>\d+)$', window.GoodsStatusView.as_view()),
    url(r'^(?P<version>[v1]+)/s_notice/$', notice.S_NoticeView.as_view({'get': 'list', 'post': 'create', })),
    url(r'^(?P<version>[v1]+)/s_notice/(?P<pk>\d+)$',
        notice.S_NoticeView.as_view({'get': 'retrieve', 'put': 'update'})),
    url(r'^(?P<version>[v1]+)/c_notice/$', notice.C_NoticeView.as_view({'get': 'list', 'post': 'create', })),
    url(r'^(?P<version>[v1]+)/noticedetail/(?P<pk>\d+)$',
        notice.NoticeDetailView.as_view({'get': 'retrieve'})),
    url(r'^(?P<version>[v1]+)/noticemanage/$', window.NoticeManageView.as_view({'get': 'list', 'post': 'create'})),
    url(r'^(?P<version>[v1]+)/noticemanage/(?P<pk>\d+)$',
        window.NoticeManageView.as_view({'get':'retrieve','delete':'destroy','put':'update'})),
]
